package com.mornd.gulimall.member.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;

import com.mornd.gulimall.common.core.entity.PageEntity;
import com.mornd.gulimall.common.core.validation.UpdateGroup;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * <p>
 * 会员等级
 * </p>
 *
 * @author mornd
 * @since 2023-07-31
 */
@Getter
@Setter
@TableName("ums_member_level")
public class MemberLevel extends PageEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @NotNull(groups = UpdateGroup.class)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 等级名称
     */
    @NotBlank
    private String name;

    /**
     * 等级需要的成长值
     */
    @NotNull
    @Min(0)
    private Integer growthPoint;

    /**
     * 是否为默认等级[0->不是；1->是]
     */
    @NotNull
    @Range(min = 0, max = 1)
    private Integer defaultStatus;

    /**
     * 免运费标准
     */
    @NotNull
    @Min(0)
    private BigDecimal freeFreightPoint;

    /**
     * 每次评价获取的成长值
     */
    @NotNull
    @Min(0)
    private Integer commentGrowthPoint;

    /**
     * 是否有免邮特权(0：没有 1：有)
     */
    @NotNull
    @Range(max = 1)
    private Integer priviledgeFreeFreight;

    /**
     * 是否有会员价格特权
     */
    @NotNull
    @Range(max = 1)
    private Integer priviledgeMemberPrice;

    /**
     * 是否有生日特权
     */
    @NotNull
    @Range(max = 1)
    private Integer priviledgeBirthday;

    /**
     * 备注
     */
    @Size(max = 255)
    private String note;


}
